<?php

class sfContactForm extends sfForm
{

  public function configure()
  {
    $this->setWidgets(array(
      'name'    => new sfWidgetFormInput(),
      'email'   => new sfWidgetFormInput(),
      'subject' => new sfWidgetFormInput(),
      'message' => new sfWidgetFormTextarea(),
      'captcha' => new sfWidgetCaptchaGD()
    ));   

    $this->setValidators(array(
      'name'   => new sfValidatorString(array('required' => true)),
      'email'  => new sfValidatorEmail(),
      'subject' => new sfValidatorString(array('required' => false)),
      'message' => new sfValidatorString(array('required' => true)),
      'captcha' => new sfCaptchaGDValidator(array('length' => 4))
    ));  

    $this->widgetSchema->setNameFormat('contact[%s]');
    
  }
}
